/******************************************************************************

   MODULE 
      LED DISPLAY (16 BIT)
      
   FILE 
       led_display.h
      
   DESCRIPTION 
   
      This Header encompasses the entire 16 bit LED module.

	  This routine uses the SPI system to output a 16 bit number to a 16 bit
	  led display. If the preprocessing function, "led_display_16" is called first
	  it's return can be used on the led_output_16 function to display a BAR
	  form or percentage of the a 16 bit maximum variable given to the function

   REQUIREMENTS

	  1. Ties ups pins RC3, RC5, RD4, RD5
	  2. +5v and 0v or GROUND for led_drive board
      
   
   USE
	
	  To use these functions, you can send any 16 bit number to led_output_16.
	  For bar graph style output, led_display_16 takes in a value "maximum_range"
	  for the maximum possible entry and also takes "vble_input_rng" as variable
	  you want to display. led_display_16 then returns a bar graph percentage
	  based on the two values, which can then be used in the led_output_16 function

	  
   
   LAST UPDATE
      3 OCT 2011     by Ben.S

   
*******************************************************************************/


#if !defined(led_display)                 /* include this file only once         */
#define led_display



/******************************************************************************
                          P U B L I C    D A T A
          N A M E D    C O N S T A N T S    A N D    M A C R O S
*******************************************************************************/

#define  TRUE                 1
#define  FALSE                0



/******************************************************************************
                          P U B L I C    D A T A
  D E F I N E D    T Y P E S    A N D    G L O B A L    V A R I A B L E S
*******************************************************************************/

typedef char *    index_t;                

/**@brief LED_DISPLAY_16 16 bit percentage calculator that returns bar percentage
@author Ben Stewart **/
unsigned int led_display_16(unsigned short long maximum_range,unsigned short long vble_input_rng);

/**@brief LED_OUTPUT_16 16 bit display routine that displays any 16 number on 16 bit led display
@author Ben Stewart **/
void led_output_16(unsigned int led_input_range);


#endif   /* if !defined(TEMPLATE)  */
